#include<stdio.h>
// incomplete
int main(){
  short int graph[10000][10000]={0};
  short int visited[10000]={0};
  int edges, nodes, i, j, a, b;
  while(scanf("%d %d",&nodes, &edges)!=EOF){
    for(i=0;i<edges;i++){
      scanf("%d %d", &a, &b);
      graph[a][b]=1;
      graph[b][a]=1;
    }
    if(nodes!=edges+1){
      printf("NO");
    }else{
      
    }
  }
}
